package com.coder520.sync_learning.demo.hookTest;

import java.util.concurrent.TimeUnit;

public class EmptyExceptionHandler {
    public static void main(String[] args){
//       获得线程所在的线程组
        ThreadGroup mainGroup=Thread.currentThread().getThreadGroup();
        System.out.println(mainGroup.getName());
        System.out.println(mainGroup.getParent());
        System.out.println(mainGroup.getParent().getParent());

        final Thread thread=new Thread(()->{
            try {
                TimeUnit.SECONDS.sleep(2);
            }catch (InterruptedException e){

            }

            //在这里将会抛出一个异常
            System.out.println(1/0);
        },"test-thread");

        thread.start();
    }
}
